#ifndef THREAD_H
#define THREAD_H

#include <qthread.h>
#include "client.h"
#include <string>
#define CLIENT_EXIT 0
#define CLIENT_CLOSE 1
#define CLIENT_LOGIN 2

struct loginTMes{
    std::string username;
    std::string password;
    int sid;
};

class clientThread:public QThread{
    Q_OBJECT
public:
    explicit clientThread(QObject *parent=0);

    void setmode(int m ){mode = m;}
    void setParam(void *m){param = m;}
    void setClient(SimpleqqClient *c){client = c;}

protected:
    void run();
    void clientRun(int);

signals:
    void SignalString(long);
    void SignalLogin(int);

    void endthread();
private:
    int mode;
    void* param;
    SimpleqqClient *client;
};

#endif // THREAD_H
